import 'package:flutter/material.dart';
import 'package:flutter_menu/res/app_color.dart';
import 'package:flutter_menu/res/app_style.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

// 已选的选项，可删除
class OptionDelete extends StatelessWidget {
  const OptionDelete({
    super.key,
    required this.label,
    this.onTap,
  });

  final String label; // 中间文字
  final VoidCallback? onTap; // 点击事件

  @override
  Widget build(BuildContext context) {
    return Row(
      crossAxisAlignment: CrossAxisAlignment.center,
      children: [
        const SizedBox(
          width: 6,
        ),
        Expanded(
          child: Text(label,
              style: TextStyle(
                  fontSize: 25.sp, color: AppColors.textInBottomSheet)),
        ),
        IconButton(
            onPressed: onTap,
            icon: Container(
              width: 22.w,
              height: 22.w,
              decoration: BoxDecoration(
                shape: BoxShape.circle,
                border: Border.all(color: AppColors.e3a671, width: 1.w), // 圆形边框
              ),
              child: Icon(
                Icons.close,
                size: 20.w,
                color: AppColors.e3a671,
              ),
            ))
      ],
    );
  }
}
